<?php
defined( '_VALID_MOS' ) or die('<script>window.location.href="http://www.kinifurniture.com";</script>');

if($code=='activation')
{
	$form='
	<form name="form1" method="post" action="index.php?show=resend&code=activation">
      <table width="95%"  border="0" align="center" cellpadding="4" cellspacing="0">
        <tr>
          <td width="30%" class="style6 style8 style7">Username</td>
          <td width="70%" class="style6"><input name="username" type="text" id="username" size="40" maxlength="100"></td>
        </tr>
        <tr>
          <td width="30%" class="style6 style8 style7">Password</td>
          <td width="70%" class="style6"><input name="password" type="password" id="Pass1" size="40" maxlength="100"></td>
        </tr>
        <tr>
          <td class="style6 style8 style7">&nbsp;</td>
          <td class="style6"><span class="style7">
            <label>
            <input type="submit" name="sumbitACT" id="sumbitACT" value="Resend Activation Code">
            </label>
          </span></td>
        </tr>
      </table>
    </form>';

	if($sumbitACT)
	{
		$qry="select * from anggota where username='$username' and password='$password'";
		$total_row=$dbh->query($qry);
		if(@mysql_num_rows($total_row)>0)
		{
			$Data=@mysql_fetch_object($total_row);
			if($functions->send_code('re_act',$username,$SITE_URL))
				echo '<script>document.location="index.php?show=message&msg=snd01";</script>';
			else
				echo '<script>document.location="index.php?show=message&msg=snd02";</script>';
		} 
		else
			echo '<script>location.href="./index.php?show=message&msg=reg03";</script>';
	}
}

if($code=='password')
{
	$form='
	<form name="form1" method="post" action="index.php?show=resend&code=password">
      <table width="95%"  border="0" align="center" cellpadding="4" cellspacing="0">
        <tr>
          <td width="30%" class="style6 style8 style7">Username</td>
          <td width="70%" class="style6"><input name="username" type="text" id="username" size="40" maxlength="100"></td>
        </tr>
        <tr>
          <td width="30%" class="style6 style8 style7">Email</td>
          <td width="70%" class="style6"><input name="email" type="text" id="email" size="40" maxlength="100"></td>
        </tr>
        <tr>
          <td class="style6 style8 style7">&nbsp;</td>
          <td class="style6"><span class="style7">
            <label>
            <input type="submit" name="submitPASS" id="submitPASS" value="Resend Password">
            </label>
          </span></td>
        </tr>
      </table>
    </form>';

	if($submitPASS)
	{
		$qry="select * from anggota where username='$username' and email='$email'";
		$total_row=$dbh->query($qry);
		if(@mysql_num_rows($total_row)>0)
		{
			$Data=@mysql_fetch_object($total_row);
			if($functions->send_code('pass',$username,$SITE_URL))
				echo '<script>document.location="index.php?show=message&msg=pwd01";</script>';
			else
				echo '<script>document.location="index.php?show=message&msg=pwd02";</script>';
		} 
		else
			echo '<script>location.href="./index.php?show=message&msg=reg03";</script>';
	}
}

?>